package org.lee.domain.service.engine.impl;

import org.lee.domain.model.aggregates.TreeRich;
import org.lee.domain.model.vo.EngineResult;
import org.lee.domain.model.vo.TreeNode;
import org.lee.domain.service.engine.EngineBase;

import java.util.Map;

/**
 * TreeEngineHandle
 *
 * @author dralee
 * @date 2021-11-22 14:11:47
 **/
public class TreeEngineHandle extends EngineBase {
    @Override
    public EngineResult process(long treeId, String userId, TreeRich treeRich, Map<String, String> decisionMatter) {
        // 决策流程
        TreeNode node = engineDecisionMaker(treeRich, treeId, userId, decisionMatter);
        return new EngineResult(userId, treeId, node.getTreeNodeId(), node.getNodeValue(), false);
    }
}
